package com.wuzhi.shop.auth.config;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class ShopWebConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
//        添加跳转的配置
/**
 *     @GetMapping("/login.html")
 *     public String loginPage(){
 *         return "login";
 *     }
 *     @GetMapping("/reg.html")
 *     public String regPage(){
 *         return "reg";
 *     }
 *     视图映射：用于请求直接跳转页面,没有数据的请求。
 */
        System.out.println("=====================跳转页面=================");

        registry.addViewController("/login.html").setViewName("login");
        registry.addViewController("/reg.html").setViewName("reg");
    }
}
